﻿using Ekton_Manage_InfrastructureCore.Repositories;
using Ekton_Manage_InfrastructureCore.SqlSugarHelper;
using Ekton_Manage_Web.Extensions.AuthMiddler;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Ekton_Manage_Web.Extensions.ServiceCollectionExtensions
{
    public static class InjectionSetup
    {
        public static void AddInjectionSetup(this IServiceCollection services)
        {
            services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
            services.AddSingleton<SqlSugarMethod>();
            services.AddSingleton<SqlSugarInstance>();
            services.AddSingleton<IAuthorizationHandler, PolicyHandler>();
            services.AddTransient(typeof(IBaseRepository<,>), typeof(BaseRepository<,>));
        }
    }
}
